﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Kokomo.PeInspector.Reflection.Disassembly
{
	/// <summary>
	/// Represents a dependency on a <see cref="string"/> from MSIL.
	/// </summary>
	public class MsilStringDependency : MsilDependency
	{
		public string String { get; private set; }
		public string GetString()
		{
			return this.String;
		}
		public int StringToken { get; private set; }
		//public override object Target
		//{
		//    get { return this.String; }
		//}

		/// <summary>
		/// Initializes a new instance of <see cref="MsilStringDependency"/>.
		/// </summary>
		/// <param name="offset">The offset of the instruction.</param>
		/// <param name="str">The string referenced.</param>
		/// <exception cref="ArgumentNullException"><paramref name="str"/> is <c>null</c>.</exception>
		public MsilStringDependency(
			Module targetModule,
			string str,
			int offset
			)
			: base(targetModule, offset)
		{
			this.String = str;
		}
	}
}
